<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Brython documentation</title>

<link rel="stylesheet" href="/brython.css">

<script src="/src/brython.js"></script>
<script src="/assets/header.brython.js"></script>

<script type="text/python3">
from browser import window, document, html, highlight

import header
header.show('es')

def run(ev):
    # run the code in the element after the button
    tg = ev.target
    while tg.tagName != 'BUTTON':
        tg = tg.parent
    exec(tg.elt.text.strip(), {})
    elt.focus()

target = 'content'
for elt in document[target].get(selector='.exec'):
    # Python code executed when user clicks on a button
    elt.contentEditable = True
    src = elt.text.strip()
    h = highlight.highlight(src)
    h.className = "pycode"
    elt.clear()
    elt <= h
    elt.focus()
    btn = html.BUTTON('▶')
    btn.bind('click', run)
    # set attribute python_code, used when button is hit
    btn.elt = elt
    elt.parent.insertBefore(btn, elt)
for elt in document[target].get(selector='.exec_on_load'):
    # Python code executed on page load
    src = elt.text.strip()
    h = highlight.highlight(src)
    h.className = "pycode"
    elt.clear()
    elt <= h
    exec(src)
for elt in document[target].get(selector='.python'):
    src = elt.text.strip()
    h = highlight.highlight(src)
    h.className = "pycode"
    elt.clear()
    elt <= h
</script>

</head>
<body onLoad="brython(1)">

<scripts>

<table id="banner" cellpadding=0 cellspacing=0>
<tr id="banner_row">
<td class="logo"><a href="/index.html" class="logo">Brython</a></td>
</tr>
</table>

<table width="100%">
<tr>
<td style="width:20%;vertical-align:top;">
<h4><a class="navig" href="intro.html">Introducción</a></h4>
<h4><a class="navig" href="install.html">Instalación</a></h4>
<h4><a class="navig" href="faq.html">Preguntas frecuentes (faq)</a></h4>
<h4><a class="navig" href="syntax.html">Sintaxis, palabras clave y funciones integradas</a></h4>
<h4><a class="navig" href="stdlib.html">Distribución estándar</a></h4>
<h4><a class="navig" href="import.html">Implementación del <tt>import</tt></a></h4>

<h4>Interfaz del navegador</h4>
<div style="padding-left:10px;">
<a class="navig" href="dom_api.html">Introducción - DOM API</a>
<br><a class="navig" href="create.html">Creando un documento</a>
<br><a class="navig" href="access.html">Accediendo a los elementos</a>
<br><a class="navig" href="attributes.html">Atributos, propriedades y métodos</a>
<br>
<br><a class="navig" href="events.html">Eventos</a>
<br><a class="navig" href="mouse_events.html">Eventos del ratón</a>
<br><a class="navig" href="keyboard_events.html">Eventos del teclado</a>
<br><a class="navig" href="focus_events.html">Eventos de foco</a>
<br><a class="navig" href="drag_events.html">Eventos de arrastre</a>
<br>
<br><a class="navig" href="query.html">Query string</a>
<br>
<br><a class="navig" href="jsobjects.html">Usando objetos y librerías Javascript</a>
</div>

<h4>Módulos específicos de Brython</h4>
<div style="padding-left:10px;">
<a class="navig" href="browser.html">El módulo integrado `browser`</a>
<br><a class="navig" href="aio.html">browser.aio</a>
<br><a class="navig" href="ajax.html">browser.ajax</a>
<br><a class="navig" href="html.html">browser.html</a>
<br><a class="navig" href="local_storage.html">browser.local_storage</a>
<br><a class="navig" href="markdown.html">browser.markdown</a>
<br><a class="navig" href="object_storage.html">browser.object_storage</a>
<br><a class="navig" href="local_storage.html">browser.session_storage</a>
<br><a class="navig" href="svg.html">browser.svg</a>
<br><a class="navig" href="template.html">browser.template</a>
<br><a class="navig" href="timer.html">browser.timer</a>
<br><a class="navig" href="webcomponent.html">browser.webcomponent</a>
<br><a class="navig" href="websockets.html">browser.websocket</a>
<br><a class="navig" href="worker.html">browser.worker</a>
<br>
<br><a class="navig" href="javascript.html">javascript</a>
</div>

<h4>Trabajando con Brython</h4>
<div style="padding-left:10px;">
<a class="navig" href="options.html">Opciones de la función <code>brython()</code></a>
<br><a class="navig" href="test.html">Testing y depuración</a>
<br><a class="navig" href="deploy.html">Desplegando una aplicación</a>
</div>

<h4>Cookbook</h4>
<div style="padding-left:10px;">
<a class="navig" href="cookbook/hello_world.html">Hola Mundo !</a>
<br><a class="navig" href="cookbook/content_in_div.html">Insertar contenido en un elemento</a>
<br><a class="navig" href="cookbook/basic_markup.html">Marcado HTML (bold,italic...)</a>
<br><a class="navig" href="cookbook/table.html">Tabla HTML</a>
<br><a class="navig" href="cookbook/bind_unbind.html">Añadir (*bind*) y eliminar (*unbind*) eventos</a>
<br><a class="navig" href="cookbook/select_checkbox.html">Handle options in a SELECT</a>
<br><a class="navig" href="cookbook/drag_drop.html">Arrastrar y soltar</a>
<br><a class="navig" href="cookbook/get_content.html">Obtener el contenido de un elemento</a>
<br><a class="navig" href="cookbook/read_file.html">Leer el contenido de un fichero</a>
<br><a class="navig" href="cookbook/local_storage.html">Almacenar objetos localmente</a>
<br><a class="navig" href="cookbook/read_text_from_imagemap.html">Ejemplo de onmouseover</a>
</div>

</td>

<td id="content" style="vertical-align:top;">
&nbsp;<content>
</td>
</tr>
</table>
</html>
